<?php
$users = $this->user;
$topics = $this->topic;
$search_val = $this->search_val;
?>

<div id="wrapper" class="white-wrapper">
    <div class="container">
        <form method="get" action="<?php echo $this->url('frontenduser',array('action'=>'search')) ?>">
            <div class=" twelve columns" style="margin-bottom: 10px;">
                <input type="text"  name="search_val" style="width: 100%" class="text" value="<?php if(isset($search_val)) echo $search_val; ?>">
            </div>
            <div class=" four columns">
                <input type="submit" style="width: 100%;
margin-top: 0px;
height: 35px;" class="button medium color " id="send" value="Search">
            </div>

        </form>

    </div>
    <!-- end: Container -->
</div>

<div id="wrapper" class="white-wrapper">
    <div class="container">
        <div class="container">
        <!-- start: Team -->
        <div class="sixteen columns">
            <h4>Thành viên: Kết quả tìm</h4>
        </div>
        </div>
        <div class="container">
        <?php
            foreach($users as $user ){

        ?>

        <!-- start: About Member -->
        <div class="four columns">
            <a href="<?php echo $this->url('frontenduser',array('action'=>'topic', 'param'=>$user->id)) ?>">
                <div class="picture">
                    <img src="<?php echo $user->avatar;  ?>" alt="">
                </div>
                <div class="team-name"><?php echo $user->name; ?></div>
            </a>
        </div>

        <!-- end: About Member -->
        <?php
            }
        ?>
        </div>
        <div class="container">
        <!--paginator -->

        <div class="sixteen columns">
            <?php // add at the end of the file after the table
            echo $this->paginationControl(
            // the paginator object
                $users,
                // the scrolling style; see http://zf2.readthedocs.org/en/release-2.1.4/modules/zend.paginator.usage.html#rendering-pages-with-view-scripts
                'sliding',
                // the partial to use to render the control
                array('partial/paginator.phtml', 'User'),
                // the route to link to when a user clicks a control link
                array(
                    'route' => 'frontenduser',
                    'child_route' => array('action'=>'search'),
                    'search_val' => $search_val
                )
            );
            ?>
        </div>
        <!--end paginator -->
        </div>

    </div>
    <!-- end: Container -->
</div>

<div id="wrapper" class="white-wrapper">

    <div class="container">
        <!-- start: Team -->
        <div class="sixteen columns">
            <h4>Sản phẩm: Kết quả tìm</h4>
        </div>
    </div>
    <div class="container">

        <?php
        foreach($topics as $topic ){
            ?>
            <!-- start: About Member -->
            <div class="four columns">
                <div class="picture">
                    <a href="<?php  echo $this->url('frontendtopic',array('action'=>'detail','id'=>$topic->id)); ?>">
                        <img src="<?php echo $topic->images ?>" alt="<?php echo $topic->short_description;  ?>">
                    </a>
                </div>
                <div class="team-name">
                    <?php echo $topic->title ?> <?php if($topic->show_price == 1){  ?>/  <span>Price: <?php echo $topic->price; ?></span><?php } ?>

                </div>
                <div class="team-about"><p><?php echo $topic->short_description; ?></p></div>
            </div>
            <!-- end: About Member -->
        <?php
        }
        ?>
    </div>
    <div class="container">
        <!--paginator -->
        <div class="sixteen columns">
            <?php // add at the end of the file after the table
            echo $this->paginationControl(
            // the paginator object
                $topics,
                // the scrolling style; see http://zf2.readthedocs.org/en/release-2.1.4/modules/zend.paginator.usage.html#rendering-pages-with-view-scripts
                'sliding',
                // the partial to use to render the control
                array('partial/paginator.phtml', 'User'),
                // the route to link to when a user clicks a control link
                array(
                    'route' => 'frontenduser',
                    'child_route' => array('action'=>'search'),
                    'search_val' => $search_val
                )
            );
            ?>
        </div>
        <!--end paginator -->
    </div>
    <!-- end: Container -->
</div>

